<!--********************************************************************
* Copyright© 2000 - 2020 SuperMap Software Co.Ltd. All rights reserved.
*********************************************************************-->
<!DOCTYPE html>
<html>

<head>
  <meta charset="UTF-8">
  <title data-i18n='resources.title_componentsSearch_Vue'></title>
  <script type="text/javascript" include="vue" src="../js/include-web.js"></script>
  <script include="ant-design-vue,iclient-mapboxgl-vue,mapbox-gl-enhance" src="../../dist/mapboxgl/include-mapboxgl.js"></script>
  <style>
    #main {
      margin: 0 auto;
      width: 100%;
      height: 100%;
    }
  </style>
</head>

<body style=" margin: 0;overflow: hidden;background: #fff;width: 100%;height:100%;position: absolute;top: 0;">
  <div id="main">
    <sm-web-map server-url='https://iportal.supermap.io/iportal' map-id="801571284">
      <!-- 搜索组件: sm-search -->
      <!-- 支持的数据：layer-names address-match  rest-map rest-data online-local-search-->
      <sm-search :layer-names="layerNames" :address-match="addressMatch" :rest-map="restMap" :online-local-search='onlineLocalSearch'></sm-search>
      </sm-web-map>
  </div>

  <script>
    new Vue({
      el: '#main',
      data() {
        var host = window.isLocal ? window.server : "https://iserver.supermap.io";
        return {
          layerNames: ["民航数据"],
          addressMatch: [
            new SuperMap.Components.commontypes.AddressMatchParameter({
              url: host + "/iserver/services/addressmatch-Address/restjsr/v1/address"
            })
          ],
          restMap: [
            new SuperMap.Components.commontypes.RestMapParameter({
              url: host + "/iserver/services/map-world/rest/maps/World",
              layerName: "Capitals@World.1",
            })
          ],
          onlineLocalSearch: {
            enable: true,
            city: "北京市"
          }
        }
      },
    })
  </script>
</body>

</html>